package cn.beyond.vehicleManagement.dao;

import cn.beyond.vehicleManagement.pojo.DrivingLicense;
import cn.beyond.vehicleManagement.pojo.SysRole;
import cn.beyond.vehicleManagement.util.DataBaseUtil;

import java.util.List;
import java.util.Map;

public class DrivingLicenseDao {
    DataBaseUtil<DrivingLicense> userDao=new DataBaseUtil<>();

    /**
     * 添加驾照信息
     * @return
     */
    public int addDrivingLicense(DrivingLicense drivingLicense){
        return    userDao.addUtil(drivingLicense,"driving_license");
    }

    /**
     * 删除用户
     * @param obj
     * @param column
     * @return
     */
    public int deleteDrivingLicense(Object obj,String column){
        return userDao.delByIdUtil(obj,"driving_license",column);

    }

    /**
     * 修改用户
     * @return
     */
    public int update(DrivingLicense drivingLicense){
        return  userDao.updateByidUtil(drivingLicense,"driving_license");
    }

    /**
     * 查询结果返回单条记录
     * @param selectmap
     * @return
     */
    public DrivingLicense selectDrivingLicenseByOne(DrivingLicense drivingLicense,
                                                    Map<String, Object> selectmap){
        return userDao.selectONE(drivingLicense,"driving_license",selectmap);
    }

    /**
     * 查询结果返回多条记录
     * @param selectmap
     * @return
     */
    public List<DrivingLicense> selectUserByCondition(DrivingLicense drivingLicense,
                                                      Map<String, Object> selectmap){
        return  userDao.selectAll(drivingLicense,"driving_license",selectmap);
    }

}
